package com.venus.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import com.venus.common.utils.MathUtil;

/**
 * CreditDebt entity. @author MyEclipse Persistence Tools
 */

public class CreditDebtVO implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	// Fields

	private Integer creditDebtId;
	//private Integer createorId;
	private PubUserVO creator;
	private String creditor;
	private String debtor;
	private Date loanDate;
	private Date payDate;
	private Date deadlineDate;
	private Float amount;
	private Float paidAmount;
	private Float interest;
	private Float paidInterest;
//	private Integer outAccountId;
//	private Integer inAccountId;
	private AccountVO outAccount;
	private AccountVO inAccount;
	private Integer isAuto;
	private Integer creditOrDebt;
	private String note;
	
	// 还款明细列表
	private Set creditDebtList = new HashSet();

	// Constructors

	/** default constructor */
	public CreditDebtVO() {
	}

	public Integer getCreditDebtId() {
		return creditDebtId;
	}

	public void setCreditDebtId(Integer creditDebtId) {
		this.creditDebtId = creditDebtId;
	}

	public PubUserVO getCreator() {
		return creator;
	}

	public void setCreator(PubUserVO creator) {
		this.creator = creator;
	}

	public String getCreditor() {
		return creditor;
	}

	public void setCreditor(String creditor) {
		this.creditor = creditor;
	}

	public String getDebtor() {
		return debtor;
	}

	public void setDebtor(String debtor) {
		this.debtor = debtor;
	}

	public Date getLoanDate() {
		return loanDate;
	}

	public void setLoanDate(Date loanDate) {
		this.loanDate = loanDate;
	}

	public Date getPayDate() {
		return payDate;
	}

	public void setPayDate(Date payDate) {
		this.payDate = payDate;
	}

	public Date getDeadlineDate() {
		return deadlineDate;
	}

	public void setDeadlineDate(Date deadlineDate) {
		this.deadlineDate = deadlineDate;
	}

	public Float getAmount() {
		return amount;
	}

	public void setAmount(Float amount) {
		this.amount = amount;
	}

	public Float getInterest() {
		return interest;
	}

	public void setInterest(Float interest) {
		this.interest = interest;
	}

	public AccountVO getOutAccount() {
		return outAccount;
	}

	public void setOutAccount(AccountVO outAccount) {
		this.outAccount = outAccount;
	}

	public AccountVO getInAccount() {
		return inAccount;
	}

	public void setInAccount(AccountVO inAccount) {
		this.inAccount = inAccount;
	}

	public Integer getIsAuto() {
		return isAuto;
	}

	public void setIsAuto(Integer isAuto) {
		this.isAuto = isAuto;
	}

	public Integer getCreditOrDebt() {
		return creditOrDebt;
	}

	public void setCreditOrDebt(Integer creditOrDebt) {
		this.creditOrDebt = creditOrDebt;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public Float getPaidAmount() {
		return paidAmount;
	}

	public void setPaidAmount(Float paidAmount) {
		this.paidAmount = paidAmount;
	}

	public Float getPaidInterest() {
		return paidInterest;
	}

	public void setPaidInterest(Float paidInterest) {
		this.paidInterest = paidInterest;
	}

	public Set getCreditDebtList() {
		return creditDebtList;
	}

	public void setCreditDebtList(Set creditDebtList) {
		this.creditDebtList = creditDebtList;
	}

	public void addPaidAmount(Float paidAmount) {
		this.paidAmount = MathUtil.round(this.paidAmount+paidAmount, 2).floatValue();
	}
	
	public void addPaidInterest(Float paidInterest) {
		this.paidInterest =  MathUtil.round(this.paidInterest+paidInterest, 2).floatValue();
	}
	
	public void subPaidAmount(Float paidAmount) {
		this.paidAmount =  MathUtil.round(this.paidAmount-paidAmount, 2).floatValue();
	}
	
	public void subPaidInterest(Float paidInterest) {
		this.paidInterest =  MathUtil.round(this.paidInterest-paidInterest, 2).floatValue();
	}
}